package com.qsmx.storetestapp;

import android.app.Application;

import androidx.multidex.MultiDexApplication;

import com.qsmx.store.core.app.Atmos;
import com.qsmx.store.core.net.HttpUrl;

import java.io.IOException;

import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;

public class StoreTestApp extends MultiDexApplication {
    @Override
    public void onCreate() {
        super.onCreate();
        Atmos.init(this)
                .withApiHost(HttpUrl.API_HOST)
                .withTestApiHost(HttpUrl.API_TEST_HOST)
                .withWebHost("www.baidu.com")
                .withJavascriptInterface("android")
                .withInterceptor(new Interceptor() {
                    @Override
                    public Response intercept(Chain chain) throws IOException {

                        Request request = chain.request()
                                .newBuilder()
//                                .addHeader("Authorization", AtmosPreference.getCustomStringPre(FustionPre.TOKEN))
                                .build();
                        return chain.proceed(request);
                    }
                })
                .configure();

    }
}
